<template>
  <div class="loading-background">
    <div class="loading">
      <span ref="loading-item" v-for="i in msg" :key="i">{{i}}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "Loading",
  props: {

  },
  data() {
    return {
      msg: 'Loading',
    };
  },
  computed: {
    ani(i) {
      return `animation-delay: ${i / 5}s;`
    }
  },
  created() {

  },
  mounted() {
    this.$refs['loading-item'].map((item, index) => item.style.animationDelay = `${index/5}s`);
  },
  watch: {

  },
  methods: {

  },
  components: {

  },
};
</script>

<style scoped lang="scss">
.loading-background {
  display: flex;
  height: 200px;
  justify-content: center;
  align-items: center;
  text-align: center;
  // background: #2980b9;

  .loading {
    display: flex;
    color: white;
    font-size: 2.5em;
    text-transform: uppercase;
    
    @media screen and (max-width: 960px){
      font-size: 1em;

      span {
        padding: 0px;
        line-height: 40px;
      }
    }

    span {
      padding: 0 20px;
      line-height: 100px;
      background: #34495e;
      animation: bulge 2s infinite;
    }
  }

  @keyframes bulge {
    50% {
      box-shadow: 0 20px 0 #eee;
      transform: translateY(-35px);
    }
  }
}



</style>
